﻿<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO, golf.Item, golf.Store,golf.RepairList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>상점</title>
</head>
<%
	DAO dao = DAO.getInstance();
	Store[] stores = dao.getStoreList();
	int charNo = (Integer)session.getAttribute("charNo");
	int ENZI = dao.getOwnEnzi(charNo);
%>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="form2">
    <table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black" width="36%">
        <tr>
            <td width="183"><span style="font-size:9pt;">현재보유엔지</span></td>
            <td width="285"><span style="font-size:9pt;"> <%out.println(ENZI);%> </span></td>
        </tr>
    </table>
    <p><span style="font-size:9pt;">&nbsp;</span></p>
</form>
<p><span style="font-size:9pt;">&nbsp;</span></p>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="form1" method="post" action="../post/postStore.jsp">
	<% 
	for( int i = 0; i < stores.length; i++ ){
		Item[] items = dao.getStoreSellingItemList(stores[i].getNo());	
	%>

    <p><span style="font-size:9pt;"><%out.println(stores[i].getOwner() + "의 " + stores[i].getName() );%></span></p>
    <table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black" width="1165">
        <tr>
            <td width="30"><span style="font-size:9pt;">&nbsp;</span></td>
            <td width="104"><span style="font-size:9pt;">아이템이름</span></td>
            <td width="60"><span style="font-size:9pt;">*필요속성</span></td>
            <td width="60"><span style="font-size:9pt;">*효과속성</span></td>
            <td width="54"><span style="font-size:9pt;">내구도</span></td>
            <td width="55"><span style="font-size:9pt;">필요레벨</span></td>
            <td width="75"><span style="font-size:9pt;">필요타이틀</span></td>
            <td width="68"><span style="font-size:9pt;">제한모델</span></td>
            <td width="55"><span style="font-size:9pt;">분류</span></td>
            <td width="55"><span style="font-size:9pt;">살때가격</span></td>
            <td width="55"><span style="font-size:9pt;">팔때가격</span></td>
            <td width="55"><span style="font-size:9pt;">할인가격</span></td>
            <td width="55"><span style="font-size:9pt;">수리단가</span></td>
            <td width="97"><span style="font-size:9pt;">수리가능여부</span></td>
        </tr>
        <%for( Item item : items ){ %>
        <tr>
            <td width="30"><p><span style="font-size:9pt;"><input type="checkbox" name="itemNo" value=<%=item.getNo() %>></span></p></td>
            <td width="104"><span style="font-size:9pt;"><%=item.getName() %></span></td>
            <td width="60"><span style="font-size:9pt;"><%=item.getReqPropertyString() %></span></td>
            <td width="60"><span style="font-size:9pt;"><%=item.getEffectPropertyString() %></span></td>
            <td width="54"><span style="font-size:9pt;"><%=item.getBasic_durability() %></span></td>
            <td width="55"><span style="font-size:9pt;"><%=item.getReq_level() %></span></td>
            <td width="75"><span style="font-size:9pt;">
            <%if(item.getReq_character_grade()!=null) 
            	out.println(item.getReq_character_grade().getName());
            else
            	out.println("없음");%></span></td>
            <td width="55"><span style="font-size:9pt;">
            <%if(item.getReq_model()!=null) 
            	out.println(item.getReq_model().getName());
            else
            	out.println("없음");%></span></td>
            <td width="45"><span style="font-size:9pt;"><%=item.getCategory_name() %></span></td>
            <td width="55"><span style="font-size:9pt;"><%=item.getBuy_price() %></span></td>
            <td width="55"><span style="font-size:9pt;"><%=item.getSell_price() %></span></td>
            <td width="55"><span style="font-size:9pt;"><%=item.getSale_price() %></span></td>
            <td width="55"><span style="font-size:9pt;"><%=item.getRepair_price() %></span></td>
            <td width="97"><span style="font-size:9pt;"><%=item.getRepair_YN() %></span></td>
        </tr>
        <%} %>
    </table>
    <span style="font-size:7pt;">*속성 (힘/임팩트/기술/체력)</span>
    <p><span style="font-size:9pt;"><input type="submit" name="action" value="buy"><input type="hidden" name="from" value="prea"></span></p>
	<%} %>
    
</form>
<p><span style="font-size:9pt;">&nbsp;</span></p>
<p><span style="font-size:9pt;">&nbsp;</span></p>
<p><span style="font-size:9pt;">&nbsp;</span></p>


<!--  수리점 -->
<form name="form8" method="post" action="../post/postRepair.jsp">
    <p><span style="font-size:9pt;">클레락</span></p>
    <% 
    //int charNo = (Integer)session.getAttribute("charNo"); 
    RepairList[] repairitems = dao.getRepairList(charNo);	
    %>
    <table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black" width="1165">
        <tr>
            <td width="48"><span style="font-size:9pt;">&nbsp;</span></td>
            <td width="104"><span style="font-size:9pt;">아이템이름</span></td>
            <td width="54"><span style="font-size:9pt;">내구도</span></td>
            <td width="96"><span style="font-size:9pt;">수리비용</span></td>
            <td width="96"><span style="font-size:9pt;">수리단가</span></td>
        </tr>
         <%if(repairitems!=null){
        	for( RepairList repairitem : repairitems ){ %>
        	 <tr>
            <td width="48"><span style="font-size:9pt;"><input type="checkbox" name="seqNo" value="<%=repairitem.getSeq_No() %>"></span></td>
            <td width="104"><span style="font-size:9pt;"><%=repairitem.getName() %></span></td>
            <td width="54"><span style="font-size:9pt;"><%=repairitem.getCurr_durability() %>/<%=repairitem.getBasic_durability() %></span></td>
            <td width="96"><span style="font-size:9pt;"><%=repairitem.getrepairprice() %></span></td>
            <td width="96"><span style="font-size:9pt;"><%=repairitem.getbrepairprice() %></span></td>
        </tr>
        	
        <%} 
       }%>
    </table>
    <p><span style="font-size:9pt;"><input type="submit" name="action" value="repair"><input type="hidden" name="from" value="clerac"></span></p>
</form>
<p><span style="font-size:9pt;">&nbsp;</span></p>
<p>&nbsp;</p>
</body>

</html>